
import 'dart:convert';

SchoolReportOverviewResult schoolReportOverviewResultFromJson(String str) =>
    SchoolReportOverviewResult.fromJson(json.decode(str));

String schoolReportOverviewResultToJson(SchoolReportOverviewResult data) =>
    json.encode(data.toJson());

class SchoolReportOverviewResult {
  SchoolReportOverviewResult({
    this.status,
    this.message,
    this.result,
  });

  int? status;
  String? message;
  Result? result;

  factory SchoolReportOverviewResult.fromJson(Map<String, dynamic> json) =>
      SchoolReportOverviewResult(
        status: json["status"],
        message: json["message"],
        result: Result.fromJson(json["result"]),
      );

  Map<String, dynamic> toJson() => {
        "status": status,
        "message": message,
        "result": result?.toJson(),
      };
}

class Result {
  Result({
    this.dataMap,
  });

  Map<String, DataMap>? dataMap;

  factory Result.fromJson(Map<String, dynamic> json) => Result(
        dataMap: Map.from(json["dataMap"])
            .map((k, v) => MapEntry<String, DataMap>(k, DataMap.fromJson(v))),
      );

  Map<String, dynamic> toJson() => {
        "dataMap": null,
        //// map 有问题，但基本不用，暂时跳过
        // Map<String, dynamic> toJson() => {
        //     "dataMap":dataMap!=null ? Map.from(dataMap).map((k, v) => MapEntry<String, dynamic>(k, v.toJson())) : null,
      };
}

class DataMap {
  DataMap({
    this.readTimes,
    this.readBooks,
    this.loginPeriod,
    this.quizTimes,
  });

  int? readTimes;
  int? readBooks;
  int? loginPeriod;
  int? quizTimes;

  factory DataMap.fromJson(Map<String, dynamic> json) => DataMap(
        readTimes: json["readTimes"],
        readBooks: json["readBooks"],
        loginPeriod: json["loginPeriod"],
        quizTimes: json["quizTimes"],
      );

  Map<String, dynamic> toJson() => {
        "readTimes": readTimes,
        "readBooks": readBooks,
        "loginPeriod": loginPeriod,
        "quizTimes": quizTimes,
      };
}
